package com.longer.playhelper.modle.biz;

import android.util.Log;

import com.longer.playhelper.modle.bean.School;

import java.util.List;

import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;

/**
 * Created by longer on 2017/7/28.
 */

public class SchoolBiz implements School.SchoolBiz {
    @Override
    public void ongetschool(int skip,final School.OnGetSchool onGetSchool) {
        BmobQuery<School> query = new BmobQuery<School>();
        query.order("-createdAt");
        query.setLimit(500);
        query.setSkip(skip);
        query.findObjects(new FindListener<School>() {
            @Override
            public void done(List<School> list, BmobException e) {
                if(e == null){
//                    Log.d("tip","长度：" + list.size());
                    onGetSchool.Success(list);
                }else{
                    e.printStackTrace();
                }
            }
        });


    }
}
